package com.project.webpage.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.project.webpage.dto.*;
import com.project.webpage.mapper.LineDailyMapper;
import com.project.webpage.mapper.LineMonthlyMapper;
import com.project.webpage.service.LineOperationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LineOperationServiceImpl implements LineOperationService {

    @Resource
    private LineDailyMapper lineDailyMapper;
    @Resource
    private LineMonthlyMapper lineMonthlyMapper;

    @Override
    @DS("secondary")
    public List<LineDailyDto> getDailyListForPage(SearchByRqRangeParam param) {
        return lineDailyMapper.selectListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<LineMonthlyDto> getMonthlyListForPage(SearchByMonthParam param) {
        return lineMonthlyMapper.selectListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<LineDailyDto> getDailyRankListForPage(LineDailyRankParam param) {
        return lineDailyMapper.selectRankListByUid(param);
    }
}
